package com.example.myapplication.ui.adapter

import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.widget.TextView
import com.example.myapplication.R
import com.example.myapplication.bean.collect.WebsiteCollectBean
import com.zhy.view.flowlayout.FlowLayout
import com.zhy.view.flowlayout.TagAdapter

/**
 *搜索热词的adapter
 *
 * @author : Kun
 * @date : 2021/6/9
 * @time : 15:26
 */
class HotKeyAdapter(var context: Context, mList: List<WebsiteCollectBean>) :
    TagAdapter<WebsiteCollectBean>(mList) {

    override fun getView(parent: FlowLayout?, position: Int, t: WebsiteCollectBean): View {
        val tv = LayoutInflater.from(context).inflate(
            R.layout.item_hot_key,
            parent,
            false
        ) as TextView
        tv.text = t.name
        return tv
    }
}